<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>统计分析报表</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/js/laydate/theme/default/laydate.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body {
            margin:0;
            padding:0;
            border:0;
            width:100%;
            height:100%;
            overflow:hidden;
        }
    </style>
</head>
<body>

<div class="role-search">
    <div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;">
        <table>
            <tr>
                <td style="width: 100%;">
                </td>
                <td style="white-space: nowrap;text-align:right;">
                    <input type="text" class="layui-input" id="yearKey" autocomplete="off" placeholder="年份">
                    <input id="quarterKey" class="mini-combobox" emptyText="季度" showNullItem='true'
                           data="[{ id: 1, name: '第一季度' },{ id: 2, name: '第二季度' },
                           { id: 3, name: '第三季度' },{ id: 4, name: '第四季度' }]"
                           textField="name" valueField="id" />
                    <a class="mini-button" plain="true" iconCls="fa fa-search" plain="true" onclick="search()">统计</a>
                    <a class="mini-button" iconCls="fa-folder-open-o" plain="true" onclick="exportExcelFile()">导出</a>
                </td>
            </tr>
        </table>
    </div>
</div>

<!--撑满页面-->
<div class="mini-fit">
    <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 100%;" ajaxType="get" multiSelect="false"
         sizeList="[20,50,100]" pageSize="50" virtualScroll="false" showPager="false" frozenStartColumn="0"
         idField="id" url="/azbj/statisticalreports/info/list">
        <div property="columns">
            <#if level ?? && level ="06">
                <div header="各地市" field="childs" headerAlign="center"></div>
            </#if>
            <#if level ?? && level ="07">
                <div header="各区县" field="childs" headerAlign="center"></div>
            </#if>
            <#if level ?? && level ="08">
                <div header="各司法所" field="childs" headerAlign="center"></div>
            </#if>
            <div header="工作机构及人员队伍" headerAlign="center" >
                <div property="columns">
                    <#if level ?? && level ="06">
                        <div width="120" headerAlign="center">省司法厅(局)
                            <div property="columns">
                                <div field="ssftjgs" width="120">工作机构</div>
                                <div field="ssftjrs" width="100">工作人员</div>
                            </div>
                        </div>
                        <div width="120" headerAlign="center">地市司法局
                            <div property="columns">
                                <div field="dssfjjgs" width="120">工作机构</div>
                                <div field="dssfjjgrs" width="100">工作人员</div>
                            </div>
                        </div>
                        <div width="120" headerAlign="center">区县司法局
                            <div property="columns">
                                <div field="qxsfjjgs" width="120">工作机构</div>
                                <div field="qxsfjjgrs" width="100">工作人员</div>
                            </div>
                        </div>
                    </#if>
                    <#if level ?? && level ="07">
                        <div width="120" headerAlign="center">地市司法局
                            <div property="columns">
                                <div field="dssfjjgs" width="120">工作机构</div>
                                <div field="dssfjjgrs" width="100">工作人员</div>
                            </div>
                        </div>
                    </#if>
                    <#if level ?? && level ="08">
                        <div width="120" headerAlign="center">区县司法局
                            <div property="columns">
                                <div field="qxsfjjgs" width="120">工作机构</div>
                                <div field="qxsfjjgrs" width="100">工作人员</div>
                            </div>
                        </div>
                    </#if>
                    <div width="120" headerAlign="center">社工信息
                        <div property="columns">
                            <div field="sgrs" width="120">社工人数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">志愿者信息
                        <div property="columns">
                            <div field="zyzrs" width="120">志愿者人数</div>
                        </div>
                    </div>
                </div>
            </div>
            <div header="衔接情况" headerAlign="center">
                <div property="columns">
                    <div width="120" headerAlign="center">衔接情况
                        <div property="columns">
                            <div field="xjzs" width="120">衔接总数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">帮教人员类别
                        <div property="columns">
                            <div field="jysf" width="80">监狱释放</div>
                            <div field="ksssf" width="100">看守所释放</div>
                            <div field="sqjzzr" width="100">社区矫正转入</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">性别
                        <div property="columns">
                            <div field="man" width="100">男性</div>
                            <div field="woman" width="100">女性</div>
                            <div field="wzxb" width="100">未知的性别</div>
                            <div field="wsmxb" width="100">未说明的性别</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">三无人员
                        <div property="columns">
                            <div field="sanwu" width="120">人数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">帮教类型
                        <div property="columns">
                            <div field="zdbj" width="120">重点帮教对象</div>
                            <div field="ybbj" width="120">一般帮教对象</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">一般帮教对象衔接方式
                        <div property="columns">
                            <div field="jczzjh" width="120">基层组织及家属接回</div>
                            <div field="ryzf" width="120">人员自返</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">重点帮教对象衔接方式
                        <div property="columns">
                            <div field="jczfjh" width="120">基层政府接回</div>
                            <div field="jssh" width="120">监所送回原籍</div>
                            <div field="sfsjh" width="120">司法所及基层组织接回</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">公安机关落实管控措施
                        <div property="columns">
                            <div field="gals" width="120">落实人数</div>
                        </div>
                    </div>
                </div>
            </div>

            <div header="安置信息" headerAlign="center">
                <div property="columns">
                    <div width="120" headerAlign="center">安置情况
                        <div property="columns">
                            <div field="azzs" width="100">安置总人次</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">企业认证为安置基地
                        <div property="columns">
                            <div field="qysjjds" width="120">省级基地数</div>
                            <div field="qysjjdrs" width="100">省级基地安置人数</div>
                            <div field="qydsjjds" width="100">地市级基地数</div>
                            <div field="qydsjjdrs" width="100">地市级基地安置人数</div>
                            <div field="qyqxjjds" width="100">区县级基地数</div>
                            <div field="qyqxjjdrs" width="100">区县级基地安置人数</div>
                            <div field="qyxzjjds" width="100">乡镇级基地数</div>
                            <div field="qyxzjjdrs" width="100">乡镇级基地安置人数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">建设政府投入为主的过渡性安置基地
                        <div property="columns">
                            <div field="gdsjjds" width="120">省级基地数</div>
                            <div field="gdsjjdrs" width="100">省级基地安置人数</div>
                            <div field="gddsjjds" width="100">地市级基地数</div>
                            <div field="gddsjjdrs" width="100">地市级基地安置人数</div>
                            <div field="gdqxjjds" width="100">区县级基地数</div>
                            <div field="gdqxjjdrs" width="100">区县级基地安置人数</div>
                            <div field="gdxzjjds" width="100">乡镇级基地数</div>
                            <div field="gdxzjjdrs" width="100">乡镇级基地安置人数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">自主创业
                        <div property="columns">
                            <div field="zzcyrs" width="120">人数</div>
                            <div field="zzcyls" width="120">落实减免税政策</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">从事个体经营
                        <div property="columns">
                            <div field="gtjyrs" width="120">人数</div>
                            <div field="gtjyls" width="120">落实减免税政策</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">企业和经济实体吸纳就业
                        <div property="columns">
                            <div field="xnjyrs" width="120">人数</div>
                            <div field="xnjyls" width="120">落实减免税政策</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">安置方式
                        <div property="columns">
                            <div field="azzrt" width="120">落实责任田</div>
                            <div field="azgyxgw" width="120">公益性岗位安置</div>
                            <div field="azzzcy" width="120">自主创业</div>
                            <div field="azgtjy" width="120">从事个体经营</div>
                            <div field="azqystjy" width="120">企业和经济实体吸纳就业</div>
                            <div field="qtaz" width="120">其他安置方式</div>
                        </div>
                    </div>
                </div>
            </div>

            <div header="帮教信息" headerAlign="center">
                <div property="columns">
                    <div width="120" headerAlign="center">帮教情况
                        <div property="columns">
                            <div field="bjzs" width="80">帮教总数</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">获得社会救助方式
                        <div property="columns">
                            <div field="zdshbzls" width="120">落实最低生活保障</div>
                            <div field="tkrypyls" width="100">落实特困人员供养</div>
                            <div field="yljzls" width="100">落实医疗救助</div>
                            <div field="jyjzls" width="100">落实教育救助</div>
                            <div field="zfjzls" width="100">落实住房救助</div>
                            <div field="shjzqtls" width="100">落实临时救助</div>
                        </div>
                    </div>
                    <div width="120" headerAlign="center">解除帮教
                        <div property="columns">
                            <div field="cxfz" width="120">重新犯罪</div>
                            <div field="slrs" width="100">失联人数</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/js/laydate/laydate.js" type="text/javascript"></script>
<script type="text/javascript">
    function max() {
        var nowDate = new Date();
        return nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
    }
    //常规用法
    //年选择器
    laydate.render({
        elem: '#yearKey'
        , type: 'year'
        ,max: max()
    });
    mini.parse();
    var grid = mini.get("datagrid1");
    var level =${level};

    if(3 != level){
        grid.setFrozenStartColumn(0);
        grid.setFrozenEndColumn(0);
    }

    function exportExcelFile() {
        var date = new Date();
        var json = mini.encode(grid.data);
        var yearKey = $("#yearKey").val();
        if (yearKey == '') {
            mini.alert("请输入年份")
            return;
        }
        if (yearKey > date.getFullYear()) {
            mini.alert("年份不符合要求")
            return;
        }
        if (json == '') {
            return;
        }
        var quarterKey = mini.get("quarterKey").getValue();
        top.location.href = encodeURI("/azbj/statisticalreports/exportExcelFile?data=" + json + "&yearKey=" + yearKey + "&quarterKey=" + quarterKey);
    }

    //查询
    function search() {
        var yearKey = $("#yearKey").val();
        if (yearKey == '') {
            mini.alert("请输入年份")
            return;
        }
        var quarterKey = mini.get("quarterKey").getValue();
        grid.load({yearKey: yearKey, quarterKey: quarterKey});
    }
</script>
<script src="/static/js/common/common.js" type="text/javascript"></script>
</body>
</html>